package com.cskaoyan.service;


import com.cskaoyan.mapper.MarketRegionMapper;
import com.cskaoyan.module.bean.BaseRespVo;
import com.cskaoyan.module.pojo.MarketRegion;
import com.cskaoyan.module.regionvo.RegionListVo;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;

import java.util.List;


@Service
public class RegionServiceImpl implements RegionService{
    @Autowired
    MarketRegionMapper marketRegionMapper;

    @Override
    public BaseRespVo query() {
        List<MarketRegion> regions = marketRegionMapper.selectByExample(null);
        RegionListVo regionListVo = new RegionListVo(regions.size(),4,regions.size(),1,regions);
        BaseRespVo<Object> baseRespVo = new BaseRespVo<>();
        baseRespVo.setErrno(0);
        baseRespVo.setErrmsg("成功");
        baseRespVo.setData(regionListVo);
        return baseRespVo;
    }
}
